import {DeviceStatusIcon, IconImg} from '@/components/images'
import {View} from '@tarojs/components'
export const LogByUser: React.FC<{
  botttomLine?: boolean
  logData: Setting.LogData
}> = ({botttomLine = true, logData}): JSX.Element => {
  return (
    <View className={`h-80 pt-18 pl-24 pr-16 pb-19 flex items-center relative`}>
      <IconImg
        imgName="user-header"
        style={{
          width: '80rpx',
          height: '80rpx',
          marginRight: '20rpx'
        }}
      ></IconImg>
      <View className="flex-1">
        <View className="w-full flex justify-between">
          <View className="hanzi flex-1 font-medium">
            {logData.operateUser}
          </View>
          <View className="hanzi w-120 text-11 text-xxx_text">
            {logData.createTime}
          </View>
        </View>
        <View className="hanzi text-14 text-xx_text">
          {logData.devLogContent}
        </View>
      </View>
      {botttomLine ? (
        <View className="hanzi absolute bottom-0 left-16 w-343 h-1 bg-border"></View>
      ) : null}
    </View>
  )
}

export const LogByDev: React.FC<{
  botttomLine?: boolean
  isLast?: boolean
  logData: Setting.LogData
  devName: string
}> = ({botttomLine = true, isLast = false, logData, devName}): JSX.Element => {
  return (
    <View className={`min-h-80 py-16 pl-24 pr-16 relative`}>
      <View className="flex justify-between items-center mb-7">
        <View className="hanzi flex-1 font-medium">{devName}</View>
        <View className="hanzi text-11 text-xxx_text">
          {logData.createTime}
        </View>
      </View>
      <View className="hanzi text-14 leading-22 text-xx_text">
        {logData.devLogContent}
      </View>
      {botttomLine ? (
        <View className="absolute bottom-0 left-16 w-343 h-1 bg-border"></View>
      ) : null}
    </View>
  )
}
